<style>
    .mui-row.mui-fullscreen>[class*="mui-col-"] {
        height: 100%;
    }

    .mui-col-xs-3,
    .mui-col-xs-9 {
        overflow-y: auto;
        height: 100%;
    }

    .mui-segmented-control .mui-control-item {
        line-height: 50px;
        width: 100%;
    }


    .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active {
        background-color: #fff;
    }
    .mui-toast-container {
        bottom: 50%;
    }
    .zcnav {
      left: 0px; right: 0px; top: 70px; z-index: 7;position: fixed; height:40px;line-height: 40px;
    }
    .zcnav a{
      font-size: 16px;
          color: #fff;
    }
    .zcnav span{
      font-size: 16px;
          margin-left: 10px;
              color: #525252;
    }
</style>
<header class="mui-bar mui-bar-nav" style="z-index:7">
			<a class=" mui-icon mui-icon-left-nav mui-pull-left"  href="/"></a>
			<h1 class="mui-title">{$title}</h1>
      <a class="mui-icon mui-icon-contact mui-pull-right" href="{:url('index/user/index')}"></a>
</header>
<div class="pref-info" style="left: 0px; right: 0px; top: 44px; z-index: 7;position: fixed;">
    <span class="pref-text">{:get_table_field('1','id', 'content', 'Page')}</span>
</div>

<div class="zcnav">
 <div  style="margin: 0;background-color:#3190e8">
 				<div class="mui-card-content">
 					<div class="mui-card-content-inner" style="padding:0;text-align:center;">
             {empty name="$Think.session.user.phone"}
             <a href="{:url('index/user/info')}">注册会员</a><span>(会员注册后享受会员特权)</span>
              {else /}
              <span style="color:#fff;  font-size: 14px;">hi 会员{$Think.session.user.name}您好,您的积分为{$Think.session.user.integral},你有{$Think.session.user.id|getCouponNum}张优惠券!</span>
             {/empty}
 					</div>
 				</div>
 	</div>
</div>


<!-- <div class="shopnav" style="left: 0px; right: 0px; top: 108px; z-index: 7;position: fixed;">
    <a class="shopnav-tab active" href="{:url($Think.cookie.shopindex)}" target='_blank'> <span class="shopnav-title">商品</span> </a>
    <a class="shopnav-tab" href="{:url('index/index/procurement')}"> <span class="shopnav-title">企业采购</span> </a>
    <a class="shopnav-tab" href="{:url('index/index/about')}"> <span class="shopnav-title">关于我们</span> </a>
</div> -->
<div class="mui-content mui-row mui-fullscreen tab1" style="    padding-top: 108px;    padding-bottom: 50px;">

    <div id="segmentedControlContents" class="mui-col-xs-12" style="border-left: 1px solid #c8c7cc;">

      <div style="padding: 10px 10px;">
        <div id="segmentedControl" class="mui-segmented-control">
          <a class="mui-control-item mui-active" href="#item1">配送</a>
          <a class="mui-control-item" href="#item2">直发</a>
        </div>
      </div>
      <div>
        <div id="item1" class="mui-control-content mui-active">
          <div id="scroll" class="">



                  <dl>

                      {volist name="plist" id="item"}
                        <dd   data-ruleid="{$item['goodsrule'][0]['id']}"  data-goodid="{$item['id']}" style="padding-bottom: 0;">
                            <span class="foodimg" style="    flex: 7;"><img  src="{$item['cover_id']|get_cover='path'}">

                              {eq name="$item['is_reserve']" value='1' }
                                  <span class="entityspecbutton" style="    background-color: #E89F31;padding: 0 .1rem;    border-radius: 0.8rem;">预售</span><span style="color:red;font-size:12px;">{$item['reserve_dec']}</span>
                              {/eq}
                            </span>
                            <section class="foodinfo" style="    padding: 0;">
                                <header class="foodtitle" ><span>{$item['good_name']}</span>

                                </header>
                                <p class="mui-ellipsis fooddescription" style="margin:3px 0;">商家:{$item['shop_id']|get_table_field="id","shopname","goodshops"}</p>
                                <p class="fooddescription"  style="margin:3px 0;">预定:{eq name="$item.sxj_type" value="0"}每日{$item.cg_ktime}点到{$item.cg_jtime}点{/eq}{eq name="$item.sxj_type" value="1"}{$item.jh_ktime}到{$item.jh_jtime}{/eq}</p>
                                <p class="fooddescription"  style="margin:3px 0;">配送:{$item['yd_fh_time']}</p>
                                <!-- <p class="foodsales"><span>月售9份</span> <span>好评率100%</span></p> -->
                                <!-- <p class="foodactivity"><span style="color: rgb(240, 115, 115);">秒杀</span><span style="background-color: rgb(255, 140, 51); border-color: rgb(255, 140, 51);">限在线支付</span></p> -->
                                {php}
                                   $priceArr = array();
                                   foreach($item['goodsrule'] as $data){
                                      $priceArr[]= $data['rule_price'];
                                   }
                                   $minPrice = min($priceArr);
                                   if(count($priceArr) > 1){
                                        $minPriceHtml = "<span>".$minPrice."</span><span class='foodprice-lowest'>起</span>";
                                   }else{
                                      $minPriceHtml = "<span>".$minPrice."</span>";
                                   }
                                {/php}




                            </section>



                        </dd>
                        <dd  data-ruleid="{$item['goodsrule'][0]['id']}"  data-goodid="{$item['id']}" style="min-height: 1.833333rem;padding: 0 10px;">
                            <p class="fooddescription"  style="margin:10px 0;">配送:{$item['good_brief']|msubstr=###,0,50}</p>
                            <strong class="foodprice" style="left: 10px;bottom: 10px;">{$minPriceHtml}  </strong>
                            <div class="mask mask-transition" style="display:none;">
                                <div class="wrap">
                                    <div class="container">
                                        <div class="specpanel">
                                            <h1>{$item['good_name']}</h1>
                                            <div class="candidators">
                                                <div class="candidators-group">
                                                    <h2>规格</h2>
                                                      {volist name="$item['goodsrule']" id="voo"  }
                                                        <a href="javascript:" class="candidator {eq name='$i' value='1'}selected {/eq}" data-info="{$voo[rule_name]}|{$voo[rule_price]}|{$voo[stock]}|{$voo[weight]}" data-ruleid="{$voo[id]}">{$voo[rule_name]}</a>
                                                      {/volist}
                                                </div>
                                                <div class="selectedresult">
                                                    <p class="selectedstr">已选：{$item['goodsrule'][0]['rule_name']} <span class='stock'>库存：{$item['goodsrule'][0]['stock']}</span> <span class='weight'>重量：{$item['goodsrule'][0]['weight']}</span></p>
                                                    <p class="price"><span class="yen">¥</span> <span class="now">{$item['goodsrule'][0]['rule_price']}</span> </p>
                                                </div>
                                                <a href="javascript:" class="cartadd" data-id="{$item['id']}" data-ruleid="{$item['goodsrule'][0]['id']}" data-dismiss="cart" data-methods="addmore" >加入购物车</a>
                                                <a href="javascript:" class="close"></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                          </div>
                                 <div class="cartbutton" style="    bottom: 5px;">
                                   <span>
                                     <span class="entitybutton">
                                       {$item['id']|getRulenumhtml}
                                       {if condition="count($item['goodsrule']) gt 1 "}
                                         <a href="javascript:" class="specadd"  ><span class="entityspecbutton"  >选规格</span></a>
                                       {else /}
                                         <a href="javascript:" class="oneaddcart" data-dismiss="cart" data-methods="addone" ><span class="mui-icon mui-icon-plus"></span></a>
                                       {/if}

                                       {eq name="$item['sxj_type']" value="0"}
                                         <script>
                                            var newDate = new Date(),time = parseFloat(newDate.getHours()+'.'+newDate.getMinutes())

                                            var cg_ktime = "{$item['cg_ktime']}"
                                            if(cg_ktime.indexOf(':')>=0){
                                              var cgs = cg_ktime.split(":");
                                              cg_ktime = cgs['0']+'.'+cgs['1']
                                            }
                                            cg_ktime = parseFloat(cg_ktime);

                                            var cg_jtime = "{$item['cg_jtime']}"
                                            if(cg_jtime.indexOf(':')>=0){
                                              var cgs = cg_jtime.split(":");
                                              cg_jtime = cgs['0']+'.'+cgs['1']
                                            }
                                            cg_jtime = parseFloat(cg_jtime);

                                            if(time>cg_ktime && time<cg_jtime){

                                            }else{
                                              $('[data-goodid="{$item[id]}"]').find('.entitybutton').html(' <a href="javascript:"   ><span class="entityspecbutton" style="background-color: rgb(169, 172, 173);"  >未到预定时间</span></a>')
                                            }

                                         </script>

                                         {else /}
                                         <script>
                                           var time = new Date().getTime(),jh_ktime = new Date("{$item['jh_ktime']}").getTime(),jh_jtime = new Date("{$item['jh_jtime']}").getTime()
                                           if(time>jh_ktime && time<jh_jtime){

                                           }else{
                                             $('[data-goodid="{$item[id]}"]').find('.entitybutton').html(' <a href="javascript:"   ><span class="entityspecbutton" style="background-color: rgb(169, 172, 173);"  >未到预定时间</span></a>')

                                           }


                                         </script>
                                       {/eq}

                                     </span>
                                   </span>
                               </div>
                        </dd>

                      {/volist}
                  </dl>

          </div>
        </div>
        <div id="item2" class="mui-control-content">





                  <dl>

                      {volist name="zlist" id="item"}
                        <dd   data-ruleid="{$item['goodsrule'][0]['id']}"  data-goodid="{$item['id']}" style="padding-bottom: 0;">
                            <span class="foodimg" style="    flex: 7;"><img  src="{$item['cover_id']|get_cover='path'}">

                              {eq name="$item['is_reserve']" value='1' }
                                  <span class="entityspecbutton" style="    background-color: #E89F31;padding: 0 .1rem;    border-radius: 0.8rem;">预售</span><span style="color:red;font-size:12px;">{$item['reserve_dec']}</span>
                              {/eq}
                            </span>
                            <section class="foodinfo" style="    padding: 0;">
                                <header class="foodtitle" ><span>{$item['good_name']}</span>

                                </header>
                                <p class="mui-ellipsis fooddescription" style="margin:3px 0;">商家:{$item['shop_id']|get_table_field="id","shopname","goodshops"}</p>
                                <p class="fooddescription"  style="margin:3px 0;">预定:{eq name="$item.sxj_type" value="0"}每日{$item.cg_ktime}点到{$item.cg_jtime}点{/eq}{eq name="$item.sxj_type" value="1"}{$item.jh_ktime}到{$item.jh_jtime}{/eq}</p>
                                <p class="fooddescription"  style="margin:3px 0;">配送:{$item['yd_fh_time']}</p>
                                <!-- <p class="foodsales"><span>月售9份</span> <span>好评率100%</span></p> -->
                                <!-- <p class="foodactivity"><span style="color: rgb(240, 115, 115);">秒杀</span><span style="background-color: rgb(255, 140, 51); border-color: rgb(255, 140, 51);">限在线支付</span></p> -->
                                {php}
                                   $priceArr = array();
                                   foreach($item['goodsrule'] as $data){
                                      $priceArr[]= $data['rule_price'];
                                   }
                                   $minPrice = min($priceArr);
                                   if(count($priceArr) > 1){
                                        $minPriceHtml = "<span>".$minPrice."</span><span class='foodprice-lowest'>起</span>";
                                   }else{
                                      $minPriceHtml = "<span>".$minPrice."</span>";
                                   }
                                {/php}




                            </section>



                        </dd>
                        <dd  data-ruleid="{$item['goodsrule'][0]['id']}"  data-goodid="{$item['id']}" style="min-height: 1.833333rem;padding: 0 10px;">
                            <p class="fooddescription"  style="margin:10px 0;">配送:{$item['good_brief']|msubstr=###,0,50}</p>
                            <strong class="foodprice" style="left: 10px;bottom: 10px;">{$minPriceHtml}  </strong>
                            <div class="mask mask-transition" style="display:none;">
                                <div class="wrap">
                                    <div class="container">
                                        <div class="specpanel">
                                            <h1>{$item['good_name']}</h1>
                                            <div class="candidators">
                                                <div class="candidators-group">
                                                    <h2>规格</h2>
                                                      {volist name="$item['goodsrule']" id="voo"  }
                                                        <a href="javascript:" class="candidator {eq name='$i' value='1'}selected {/eq}" data-info="{$voo[rule_name]}|{$voo[rule_price]}|{$voo[stock]}|{$voo[weight]}" data-ruleid="{$voo[id]}">{$voo[rule_name]}</a>
                                                      {/volist}
                                                </div>
                                                <div class="selectedresult">
                                                    <p class="selectedstr">已选：{$item['goodsrule'][0]['rule_name']} <span class='stock'>库存：{$item['goodsrule'][0]['stock']}</span> <span class='weight'>重量：{$item['goodsrule'][0]['weight']}</span></p>
                                                    <p class="price"><span class="yen">¥</span> <span class="now">{$item['goodsrule'][0]['rule_price']}</span> </p>
                                                </div>
                                                <a href="javascript:" class="cartadd" data-id="{$item['id']}" data-ruleid="{$item['goodsrule'][0]['id']}" data-dismiss="cart" data-methods="addmore" >加入购物车</a>
                                                <a href="javascript:" class="close"></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                          </div>
                                 <div class="cartbutton" style="    bottom: 5px;">
                                   <span>
                                     <span class="entitybutton">
                                       {$item['id']|getRulenumhtml}
                                       {if condition="count($item['goodsrule']) gt 1 "}
                                         <a href="javascript:" class="specadd"  ><span class="entityspecbutton"  >选规格</span></a>
                                       {else /}
                                         <a href="javascript:" class="oneaddcart" data-dismiss="cart" data-methods="addone" ><span class="mui-icon mui-icon-plus"></span></a>
                                       {/if}

                                       {eq name="$item['sxj_type']" value="0"}
                                         <script>
                                            var newDate = new Date(),time = parseFloat(newDate.getHours()+'.'+newDate.getMinutes())

                                            var cg_ktime = "{$item['cg_ktime']}"
                                            if(cg_ktime.indexOf(':')>=0){
                                              var cgs = cg_ktime.split(":");
                                              cg_ktime = cgs['0']+'.'+cgs['1']
                                            }
                                            cg_ktime = parseFloat(cg_ktime);

                                            var cg_jtime = "{$item['cg_jtime']}"
                                            if(cg_jtime.indexOf(':')>=0){
                                              var cgs = cg_jtime.split(":");
                                              cg_jtime = cgs['0']+'.'+cgs['1']
                                            }
                                            cg_jtime = parseFloat(cg_jtime);

                                            if(time>cg_ktime && time<cg_jtime){

                                            }else{
                                              $('[data-goodid="{$item[id]}"]').find('.entitybutton').html(' <a href="javascript:"   ><span class="entityspecbutton" style="background-color: rgb(169, 172, 173);"  >未到预定时间</span></a>')
                                            }

                                         </script>

                                         {else /}
                                         <script>
                                           var time = new Date().getTime(),jh_ktime = new Date("{$item['jh_ktime']}").getTime(),jh_jtime = new Date("{$item['jh_jtime']}").getTime()
                                           if(time>jh_ktime && time<jh_jtime){

                                           }else{
                                             $('[data-goodid="{$item[id]}"]').find('.entitybutton').html(' <a href="javascript:"   ><span class="entityspecbutton" style="background-color: rgb(169, 172, 173);"  >未到预定时间</span></a>')

                                           }


                                         </script>
                                       {/eq}

                                     </span>
                                   </span>
                               </div>
                        </dd>

                      {/volist}
                  </dl>

















        </div>
      </div>





    </div>

    <div class="cartmask fold-transition" _v-fd8ba416="" style="z-index: 8;display: none;"></div>
    <div class="cartbody fold-transition"  style=" z-index: 9;display:none;">
        <div class="cartheader" ><span class="cartheader-text" >购物车</span> <a href="javascript:" class="cartheader-remove" ><span class="mui-icon mui-icon-trash"></span> <span >清空</span></a></div>
        <div class="cartbody-scroller" >
            <!-- <div class="piecewise-tips" ><b >阶梯配送费</b> 满70免配送费</div> -->
            <ul class="cartlist" >
            </ul>
            <script id="tpl" type="text/html">
            {{each  as value i}}
              <li class="entityrow" data-boxruleid="{{value.rule_id}}" data-boxgoodid="{{value.good_id}}"  >
                <span class="entityname" ><em class="name" >{{value.good_name}} {{value.rule_name}}</em></span>
                <span class="entitytotal" >{{value.good_price*value.num}}</span>
                <span  class="entitycartbutton">
                  <span class="entitybutton">
                    <a href="javascript:" data-dismiss="cart" data-methods="minusbox" data-cartid="{{value.id}}"  style="padding:0" ><span class="mui-icon mui-icon-minus"></span></a>
                    <span class="entityquantity">{{value.num}}</span>
                    <a href="javascript:" data-dismiss="cart" data-methods="addbox" style="padding:0" ><span class="mui-icon mui-icon-plus"></span></a>
                  </span>
                </span>
              </li>
            {{/each}}
            </script>
        </div>
    </div>
    <nav class="mui-bar mui-bar-tab" style="      border-bottom: none;    background-color: #3d3d3f;    padding-left: 2.164384rem;">
        <span class="carticon {empty name='$cartSum'}empty{/empty}"  attr-quantity="{$cartSum}"></span>
        <div class="cartprice" ><span class="carttotal" >¥<i>{$cartCountprice}</i></span> <span class="cartdelivery" ></span></div><a href="javascript:;" data-url="{:url('index/cart/indexsub')}" class="submitbutton" >去结算</a>
    </nav>
</div>
